Optimal. Leaf size=80 \[ -\frac{a^2 (c-i d) \tan (e+f x)}{f}-\frac{2 a^2 (d+i c) \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)+\frac{d (a+i a \tan (e+f x))^2}{2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0682502, antiderivative size = 80, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 26, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.115, Rules used = {3527, 3477, 3475} \[ -\frac{a^2 (c-i d) \tan (e+f x)}{f}-\frac{2 a^2 (d+i c) \log (\cos (e+f x))}{f}+2 a^2 x (c-i d)+\frac{d (a+i a \tan (e+f x))^2}{2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3527
Rule 3477
Rule 3475
Rubi steps
\begin{align*} \int (a+i a \tan (e+f x))^2 (c+d \tan (e+f x)) \, dx &=\frac{d (a+i a \tan (e+f x))^2}{2 f}-(-c+i d) \int (a+i a \tan (e+f x))^2 \, dx\\ &=2 a^2 (c-i d) x-\frac{a^2 (c-i d) \tan (e+f x)}{f}+\frac{d (a+i a \tan (e+f x))^2}{2 f}+\left (2 a^2 (i c+d)\right ) \int \tan (e+f x) \, dx\\ &=2 a^2 (c-i d) x-\frac{2 a^2 (i c+d) \log (\cos (e+f x))}{f}-\frac{a^2 (c-i d) \tan (e+f x)}{f}+\frac{d (a+i a \tan (e+f x))^2}{2 f}\\ \end{align*}
Mathematica [B] time = 2.39605, size = 263, normalized size = 3.29 \[ \frac{a^2 \sec (e) \sec ^2(e+f x) (\cos (2 f x)+i \sin (2 f x)) \left (-8 (c-i d) \cos (e) \cos ^2(e+f x) \tan ^{-1}(\tan (3 e+f x))-i \left ((d+i c) \cos (e+2 f x) \left (4 f x-i \log \left (\cos ^2(e+f x)\right )\right )+2 \cos (e) \left ((c-i d) \log \left (\cos ^2(e+f x)\right )+4 i c f x+4 d f x-i d\right )-2 i c \sin (e+2 f x)+4 i c f x \cos (3 e+2 f x)+c \cos (3 e+2 f x) \log \left (\cos ^2(e+f x)\right )+2 i c \sin (e)-4 d \sin (e+2 f x)+4 d f x \cos (3 e+2 f x)-i d \cos (3 e+2 f x) \log \left (\cos ^2(e+f x)\right )+4 d \sin (e)\right )\right )}{4 f (\cos (f x)+i \sin (f x))^2} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.004, size = 123, normalized size = 1.5 \begin{align*} -{\frac{{a}^{2} \left ( \tan \left ( fx+e \right ) \right ) ^{2}d}{2\,f}}-{\frac{{a}^{2}c\tan \left ( fx+e \right ) }{f}}+{\frac{2\,i{a}^{2}d\tan \left ( fx+e \right ) }{f}}+{\frac{i{a}^{2}\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) c}{f}}+{\frac{{a}^{2}\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) d}{f}}-{\frac{2\,i{a}^{2}\arctan \left ( \tan \left ( fx+e \right ) \right ) d}{f}}+2\,{\frac{{a}^{2}\arctan \left ( \tan \left ( fx+e \right ) \right ) c}{f}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47441, size = 112, normalized size = 1.4 \begin{align*} -\frac{a^{2} d \tan \left (f x + e\right )^{2} - 4 \,{\left (a^{2} c - i \, a^{2} d\right )}{\left (f x + e\right )} - 2 \,{\left (i \, a^{2} c + a^{2} d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right ) + 2 \,{\left (a^{2} c - 2 i \, a^{2} d\right )} \tan \left (f x + e\right )}{2 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.62135, size = 339, normalized size = 4.24 \begin{align*} -\frac{2 \,{\left (i \, a^{2} c + 2 \, a^{2} d +{\left (i \, a^{2} c + 3 \, a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} +{\left (i \, a^{2} c + a^{2} d +{\left (i \, a^{2} c + a^{2} d\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \,{\left (i \, a^{2} c + a^{2} d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 2.65736, size = 121, normalized size = 1.51 \begin{align*} - \frac{2 a^{2} \left (i c + d\right ) \log{\left (e^{2 i f x} + e^{- 2 i e} \right )}}{f} + \frac{- \frac{\left (2 i a^{2} c + 4 a^{2} d\right ) e^{- 4 i e}}{f} - \frac{\left (2 i a^{2} c + 6 a^{2} d\right ) e^{- 2 i e} e^{2 i f x}}{f}}{e^{4 i f x} + 2 e^{- 2 i e} e^{2 i f x} + e^{- 4 i e}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.46287, size = 309, normalized size = 3.86 \begin{align*} \frac{-2 i \, a^{2} c e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, a^{2} d e^{\left (4 i \, f x + 4 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 4 \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 i \, a^{2} c e^{\left (2 i \, f x + 2 i \, e\right )} - 6 \, a^{2} d e^{\left (2 i \, f x + 2 i \, e\right )} - 2 i \, a^{2} c \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 \, a^{2} d \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 2 i \, a^{2} c - 4 \, a^{2} d}{f e^{\left (4 i \, f x + 4 i \, e\right )} + 2 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]